<template>
  <div class="charts" ref="echarts"></div>
</template>

<script>
import * as echarts from "echarts";
export default {
  name: "LineEcharts",
  mounted() {
    var LineEcharts = echarts.init(this.$refs.echarts);
    var option;
    option = {
      xAxis: {
        type: "category",
        show: false,
      },
      yAxis: {
        show: false,
      },
      // 图标样式
      series: [
        {
          data: [15, 23, 22, 21, 13, 17, 60, 12, 34, 12],
          type: "line",
          // 拐点设置
          itemStyle: {
            opacity: 0,
          },
          // 线条设置
          lineStyle: {
            color: "purple",
          },
          // 颜色渐变填充
          areaStyle: {
            color: {
              type: "linear",
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [
                {
                  offset: 0,
                  color: "purple", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "#fff", // 100% 处的颜色
                },
              ],
              global: false, // 缺省为 false
            },
          },
     
        },
    
      ],
      // 布局
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
      },
      // 悬浮提示
      tooltip: {
        show:true
      },
   
    };

    option && LineEcharts.setOption(option);
  },
};
</script>

<style scoped>
.charts {
  width: 100%;
  height: 100%;
}
</style>